<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 1.求1-100平均值
        var sum1 = 0;
        var a = 0;
        for (i = 1; i <= 100; i++) {
            sum1 += i;
        }
        a = sum1 / 100;

        //求1-100之间所有偶数和奇数的和
        var even = 0;
        var odd = 0;
        for (i = 1; i <= 100; i++) {
            if (i % 2 == 0) {
                even += i;
            } else {
                odd += i;
            }
        }
    </script>
</head>

<body>

</body>

</html>